package com.wkbb.basic.utils.jvt;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.io.Serializable;

/**
 * 巨龙实体类，字段要大些，不然设备无法注册
 *
 * @author Alger Yang
 * @date 2019/9/24 002414:05
 */
@Data
public class JvtBoxBean implements Serializable {

    @JsonProperty(value = "Name")
    @JSONField(name = "Name")
    private String name;

    @JsonProperty(value = "Code")
    @JSONField(name = "Code")
    private Integer code;

    @JsonProperty(value = "Message")
    @JSONField(name = "Message")
    private String message;

    @JsonProperty(value = "Data")
    @JSONField(name = "Data")
    private JSONObject data;

    @JsonProperty(value = "UUID")
    @JSONField(name = "UUID")
    private String uuid;

    @JsonProperty(value = "Session")
    @JSONField(name = "Session")
    private String session;

    @JsonProperty(value = "TimeStamp")
    @JSONField(name = "TimeStamp")
    private Long timeStamp;

    @JsonProperty(value = "Sign")
    @JSONField(name = "Sign")
    private String sign;

    /**
     * 使用注册人脸队列的时候使用
     */
    private String faceUrl;

    /**
     * 使用注册人脸队列的时候使用
     */
    private String action;

    public void clearPersonPhoto() {
        JSONObject personInfo = data.getJSONObject("PersonInfo");
        if (personInfo == null) {
            return;
        }

        personInfo.put("PersonPhoto", "");
    }

}
